﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using StockCrawlerLib.DAL;
using DevExpress.Web;

namespace StockCrawler
{
    public partial class CEStockList : System.Web.UI.Page
    {
        private HistoryRepository _objHistoryRepo = new HistoryRepository();
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                InitMasterGrid();
                
            }
        }

        private void InitMasterGrid()
        {
            //StockGridView.DataSource = _objHistoryRepo.SelectByFilter(false, 0, 3, 0);
            //StockGridView.PageIndex = 0;
            //StockGridView.DataBind();
        }
        //protected void HistoryGridView_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
        //{
        //    string[] args = e.Parameters.Split('|');
        //    if (args == null || args.Length == 0)
        //        return;

        //    if (args[0].Equals("REFRESH"))
        //    {
        //        //StockGridView.Det
        //        //HistoryGridView1.DataSource = _objHistoryRepo.SelectByFilter(false, 0, 3, 0);
        //        //HistoryGridView1.DataBind();
        //    }
        //}

        protected void StockDataSource_Selecting(object sender, DevExpress.Data.Linq.LinqServerModeDataSourceSelectEventArgs e)
        {
            //var result = from p in _objHistoryRepo.SelectByFilter(false, 0, 3, 0)
            //e.QueryableSource = result.AsQueryable<stock>;
        }
    }
}